import React from 'react'
import { Link, Outlet } from 'react-router-dom'

export default function List() {
  const posts = [{ name: 'react', id: 1, description: 'hello' }, {
    name: 'js', id: 2, description: 'world'
  }]

  return (
    <div className="posts_wrap">
      {posts.map((post) => (
        <div className="post_item" key={post.id}>
          <Link to={`/c/${post.id}`}>
            <div className="name">{post.name}</div>
          </Link>
        </div>
      ))}
      <Outlet />
    </div>
  )
}